package com.mall.user.domain.model;

public record UserName(String name) {
    public UserName {
        if (name == null || name.isEmpty()) {
            throw new IllegalArgumentException("用户名不能为空");
        }
    }

    public static UserName of(String name){
        String trimmed= name==null?null:name.trim();
        return new UserName(trimmed);
    }
}
